<?php

class Default_Model_Newsitem extends Zend_Db_Table_Abstract{
    public $_name="news_item";            
    public function getAllData(){
		$query = $this->select()
                        ->setIntegrityCheck(false)
                        ->from(array('i'=>$this->_name),array('i.itemId','i.itemName'))
                        ->where('i.display = 1')
                        ->order('i.ord asc'); 
        return $this->fetchAll($query);
    }    
    public function getDataByCatId($catId){
		$query = $this->select()
                        ->setIntegrityCheck(false)
                        ->from(array('i'=>$this->_name),array('i.itemId','i.itemCode','i.itemName','i.shortName','i.ord','i.display'))                        
                        ->where('i.catId = ?',(int)$catId);
        return $this->fetchAll($query);
    } 
}